package com.ali.goods.controller;

import com.ali.goods.domain.ZxDemo;
import com.ali.goods.service.ZxDemoService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("demo")
public class DemoController {

    @Autowired
    ZxDemoService zxDemoService;

    @GetMapping("test")
    public ZxDemo test1(Integer id){
        LambdaQueryWrapper<ZxDemo> wrapper = new LambdaQueryWrapper();
        wrapper.eq(ZxDemo::getId,id);
        ZxDemo one = zxDemoService.getOne(wrapper);
        return one;
    }
}
